package com.aaa.dao;

import com.aaa.dto.AddOrderDto;
import com.aaa.dto.OrderDetailDto;
import com.aaa.dto.OrderDto;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface OrderDao {
    // 跟据用户id查询订单
    List<OrderDto> findAllOrderByUserId(Integer userId);

    // 跟据订单id查询订单详细
    List<OrderDetailDto> findOrderDetailByOrderId(Integer orderId);

    // 更新订单状态
    int updateStatusByOrderId(Integer orderId);

    // 删除订单
    int deleteOrderByOrderId(Integer orderId);

    // 删除订单详细
    int deleteOrderDetailByOrderId(Integer orderId);

    // 更新订单状态4
    int updateStatusByOrderId_4(Integer orderId);

    //更新订单状态1
    int updateStatusByOrderId_1(Integer orderId);

    // 跟据用户id添加新的订单
    int addOrderByUserId(AddOrderDto addOrderDto);

    // 跟据订单id添加新的订单
    int addOrderDetailByOrderId(AddOrderDto addOrderDto);
}
